﻿@using MvcPaging
@model MvcPaging.IPagedList<TuanAnhPersonalWeb.Models.ProjectModel>


<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
       
        <th>
            PROJECT_NAME
        </th>
        <th>
            LOCATION
        </th>
        <th>
            INVERSTER
        </th>
        <th>
            IMAGE_DIR
        </th>
      
        <th>
            CREATEDATE
        </th>
        <th>
         TYPE
        </th>
        <th></th>
    </tr>
     @if (Model.Count > 0)
       {
           foreach (var item in Model)
           {
    <tr>
        
        <td>
            @Html.DisplayFor(modelItem => item.PROJECT_NAME)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LOCATION)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.INVERSTER)
        </td>
      
        <td>
           <img src=@item.IMAGE_DIR width="100px" height="100px"/>
        </td>
    
        <td>
            @String.Format("{0:dd/MM/yyyy}", item.CREATEDATE)
        </td>
        <td>
        @Html.DisplayFor(m => item.PDESCRIPTION)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.PROJECT_ID }) |
            @Html.ActionLink("Details", "Details", new { id = item.PROJECT_ID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.PROJECT_ID })
        </td>
    </tr>
         }}
           
           else
           {
               <tr>
            <td colspan="3" align="center">No data to display</td>
        </tr>
           }


</table>
<div class="pager">
  @Ajax.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "Project", action = "Search", keySearch = ViewData["keySearch"], valSearch = ViewData["valSearch"],keyFilter=ViewData["keyFilter"]  }, new AjaxOptions { UpdateTargetId = "divGrid", OnBegin = "beginPaging", OnSuccess = "successPaging" })
 </div>
